<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>日志记录</title>
<script type="text/javascript"
	src="<c:url value='/static/themes/js/jquery.datatables.min.js'/>"></script>
</head>
<body>
	<!-- panel-body -->
	<!-- panel -->
	<div id="message"></div>
	<div class="panel panel-default">
		<div class="panel-body">
			<div class="table-responsive">
				<div id="table1_wrapper" class="dataTables_wrapper no-footer">
					<table id="table" class="table dataTable no-footer  table-striped"
						role="grid" aria-describedby="table1_info">
						<thead>
							<tr role="row">
								<th>用户名</th>
								<th>角色</th>
								<th>操作时间</th>
								<th>登陆ip</th>
								<th>操作描述</th>
								<th>执行结果</th>
							</tr>
						</thead>
					</table>
				</div>
			</div>
		</div>
	</div>

	<script type="text/javascript">
		$(function($) {
			//table展示
			var table = $('#table').DataTable({
				"processing" : true,
				"serverSide" : true,
				"bLengthChange" : false,
				"bFilter" : false,
				"bSort" : false,
				"bDestroy" : true,
				"language" : {
					"url" : path + "/static/language_datatables.json"
				},
				"ajax" : {
					"url" : path + "/log/getUserList",
					"type" : "POST",
				},
				"oSearch" : {

				},
				"columns" : [ {
					"data" : "username",
					"width" : "10%"
				}, {
					"data" : "rolenames",
					"width" : "10%"
				}, {
					"data" : "createtime",
					"width" : "10%"
				}, {
					"data" : "ip",
					"width" : "10%"
				}, {
					"data" : "logDesc",
					"width" : "20%"
				}, {
					"data" : "logStatus",
					"width" : "7%"
				}, ],
				"columnDefs" : [

				{
					"render" : function(data, type, row) {
						return dateTimeFormatter(data);
					},
					"targets" : 2
				}, {
					"render" : function(data, type, row) {
						return data == '1' ? '成功' : '失败';
					},
					"targets" : 5
				} ]

			});
			function doSearch(refresh) {
				if (refresh) {
					table.ajax.reload(null, false);
				} else {
					table.ajax.reload();
				}
			}
		});
	</script>
</body>
</html>